<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class Index extends CI_Controller {
	function __construct(){
		parent::__construct();
	}
	public function index()
	{
		
		$data=array("cof"=>"FORID:10","ie"=>"UTF-8","q"=>$_POST["word"],"sa"=>"搜索");
		switch ($_POST["category"]){
			case "site":
				$data["cx"] = "015031954425074895936:mn87cl-7mj8";
				break;
			case "share":
				$data["cx"] = "015031954425074895936:1sk8rloimha";
				break;
			case "recall":
				$data["cx"] = "015031954425074895936:k6k5c51jf2y";
				break;
			default:
				$data["cx"] = "015031954425074895936:mn87cl-7mj8";
				break;
		}
		$str = array();
		foreach ($data as $key => $val){
			$str[] = $key . "=" . urlencode($val);
		}
		
		$get_str = implode("&", $str);
		
		$url = "search/result.html?" . $get_str;
		
		$this->parser->parse("header",array("title" => "学海拾贝 - 搜索结果"));
		$this->parser->parse("search/result",array("url" => $url));
		$this->parser->parse("footer",array());
	}
}

/* End of file index.php */
/* Location: ./application/controllers/index.php */